package one;

import java.util.Scanner;

public class test11076 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.next();
        if (input.contains("(")) {
            getNum1(input);
        } else {
            getNum2(input);
        }

    }

    private static void getNum2(String input) {
        String s = input.substring(2);
        numToSimply(Long.parseLong(s), (long) Math.pow(10, s.length()));
    }

    private static void numToSimply(long up, long down) {
        long a = up;
        long b = down;
        long r = 1;
        do {
            r = a % b;
            a = b;
            b = r;
            /*
            辗转相除法
            a对b取余，b赋值给a 余数赋值给b，，直到 b == 0
             */
        } while (b != 0);
        System.out.println(up / a + " " + down / a);
    }

    private static void getNum1(String input) {
        int index = input.indexOf("(");
        String s = input.substring(index + 1, input.length() - 1);
        int num1 = s.length();
        int num = input.length() - 4 - num1;
        long up1 = 0;
        if (index != 2) {
            up1 = Long.parseLong(input.substring(2, index));
        }
        long down2 = (long) Math.pow(10, num1) - 1;
        long up2 = Long.parseLong(s) + up1 * down2;
        long down3 = down2 * ((long) Math.pow(10, num));
        numToSimply(up2, down3);
    }
}
